<?php
namespace app\modules\film\models;


use app\common\base\ApiModel;

class RecordTicketBuy extends ApiModel{

    public static function tableName(){
        return 'record_ticket_buy';
    }


    public function rules()
    {
        return [
            [['user_id', 'amount', 'seat_num', 'ticket_id'], 'required'],
            [['user_id', 'amount', 'status', 'create_timestamp', 'seat_num', 'ticket_id'], 'integer'],
            ['date_time', 'date']
        ];
    }

    public function getFilmBasic(){
        return $this->hasMany(FilmTicket::class, ['id' => 'ticket_id'])->with('filmName');
    }

    // public function fields()
    // {
    //     $fields = parent::fields();

    //     print_r($fields);die;
    // }


}